#ifndef EPARAMANIMATIONSET_H
#define EPARAMANIMATIONSET_H

#include "eanimation.h"

template <typename T, typename Controller>
class EParamAnimationSet
{
    EAnimationSet<T, Controller> m_animSet;
    bool m_bEnabled;
public:
    EParamAnimationSet()
        : m_bEnabled(false)
    {

    }

    bool addAnimation(Controller* pController,
                      boost::shared_ptr<ESprite> sprite,
                      std::string& name,
                      bool (Controller::*updater)(T &, T),
                      void (ESprite::*setter)(T),
                      T (ESprite::*getter)
                      )
    {
        boost::shared_ptr<EAnimation<T, Controller> > pAnim(new EAnimation<T, Controller>(sprite, pController));
        pAnim->setGetter(getter);
        pAnim->setSetter(setter);
        pAnim->setUpdater(updater);

        m_animSet->addAnimation(name, pAnim);

        m_bEnabled = true;
        return true;
    }

    void setCurrentAnimation(const std::string& name)
    {
        return m_animSet.setCurrentAnimation(name);
    }

    bool isEnabled()
    {
        return m_bEnabled;
    }

    void enable(bool bEnable = true)
    {
        m_bEnabled = bEnable;
    }
};

#endif // EPARAMANIMATIONSET_H
